package com.dxtan90.utils;

import com.dxtan90.config.SysConfig;

import java.awt.*;

/**
 * @author: shijunhao
 * @date: 2021/12/1 22:23
 * @description:
 */
public class ConfigUtils {
    //系统配置
    private volatile static SysConfig config = null;
    //系统分辨率
    private static Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
    private ConfigUtils(){}

    public static SysConfig getConfig(){
        if(config == null){
            synchronized (SysConfig.class){
                if(config == null){
                    config = new SysConfig().loadConfig();
                }
            }
        }
        return config;
    }


    public static Dimension getDimension(){
        return dimension;
    }
}
